package com.hnkywl.sts.action.flow.endState;

import com.hnkywl.sts.entity.organ.LjLs;
import com.hnkywl.sts.entity.organ.Qyjg;
import com.hnkywl.sts.service.organ.LjLsService;
import com.hnkywl.sts.service.organ.LjwhService;
import com.hnkywl.sts.service.organ.QyjgService;
import com.hnkywl.sts.util.ApplicationInstance;
import org.jbpm.api.listener.EventListener;
import org.jbpm.api.listener.EventListenerExecution;

/**
 * Created with IntelliJ IDEA.
 * User: Jerry
 * Date: 13-7-25
 * Time: 下午2:05
 * To change this template use File | Settings | File Templates.
 */
public class EndGysState implements EventListener {
    @Override
    public void notify(EventListenerExecution execution) throws Exception {
        // 改变状态  ytj--->ysp
        LjLsService ljLsService = ApplicationInstance.createLjLsService();
        LjLs ljls = ljLsService.finLjLsDetailByProcessInstance(execution.getProcessInstance().getId());
        ljls.setZt("ysp");
        ljls.setYtb(true);
        ljLsService.transLj(ljls);
        ljLsService.updateLjLs(ljls);
    }
}
